package com.dabai.iot.core.api;

import com.dabai.iot.core.entity.DeviceEntity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 设备服务 stub
 *
 * @author kev1n
 */
@Slf4j
@RequiredArgsConstructor
public class RemoteDeviceServiceStub implements RemoteDeviceService {

    private final RemoteDeviceService remoteDeviceService;

    @Override
    public DeviceEntity getDeviceCacheBySn(String productKey, String deviceSn) {
        try {
            return remoteDeviceService.getDeviceCacheBySn(productKey, deviceSn);
        } catch (Exception e) {
            log.warn("Dubbo - 设备服务未找到");
            return null;
        }
    }

}
